package com.offcn.login;

import com.offcn.dao.StudentDao;
import com.offcn.entity.Student;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/update")
public class UpdateServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        StudentDao sd = new StudentDao();
        Student s1 = sd.stuSinSer(Integer.parseInt(id));
        req.setAttribute("s1",s1);
        req.getRequestDispatcher("/update.jsp").forward(req,resp);
    }
}
